package com.bstek;

import java.io.IOException;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;

import com.alibaba.fastjson.JSON;
import com.bstek.urule.Execute;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Dict;

@SpringBootApplication
@ImportResource({ "classpath:urule-core-context.xml" })
public class EdasRuleClientApplication {
	public static void main(String[] args) throws IOException {
		SpringApplication.run(EdasRuleClientApplication.class, args);

		Dict param = Dict.create().set("name", "User").set("clazz", "com.baidu").set("variables",
				CollectionUtil.newArrayList(
						Dict.create().set("name", "id").set("label", "id").set("type", "String").set("defaultValue", "1"),
						Dict.create().set("name", "name").set("label", "姓名").set("type", "String").set("defaultValue", "刘小刚"),
						Dict.create().set("name", "age").set("label", "年龄").set("type", "Integer").set("defaultValue", "15"),
						Dict.create().set("name", "score").set("label", "得分").set("type", "Integer").set("defaultValue", "0"),
						Dict.create().set("name", "sex").set("label", "性别").set("type", "Integer").set("defaultValue", "0")));

		Execute e = new Execute();
		e.exec("胶州/user_score", CollectionUtil.newArrayList(param));
	}

}
